package com.summarecon.qualitycontrol;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class MenuActivity extends Activity{
	public Context ctx=this;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_menu);
        ListView listView1 = (ListView) findViewById(R.id.listMenu);
       
        String[] menuArray = { "New Entry","Data Entry","Schedule","Note"};
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, menuArray);
    
        listView1.setAdapter(adapter);
        
        listView1.setOnItemClickListener(new OnItemClickListener() {
        	@Override
			public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
        		
        		switch( position )
        	    {
        	       case 0:  Intent newActivity = new Intent(getBaseContext(), LocationActivity.class);   
        	                startActivity(newActivity);
        	                break;
        	      
        	    }
			   
			}
		});
	}
	
}
